<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
  <head>
    <title>资源列表</title>
    <link href="css/general.css" rel="Stylesheet" type="text/css" />
  </head>
  
  <body id="listResourcePage">
  
  <div align="center">
			<s:form action="listResource" method="post">

				<%--下面三句可以不动			--%>
				<s:hidden name="page"></s:hidden>
				<s:if test="#request.pageView.totalRecord">
					<table class="admin_table">
						<tr><td>编号</td><td>资源名称</td><td>类型</td><td>描述</td><td>图片</td><td>资源路径</td><td>操作者</td><td>创建时间</td><td>修改时间</td><td>操作</td></tr>
						<s:iterator value="#request.pageView.records" id="entity">
						<tr>
								<td>
									<s:property value="#entity.id" />
								</td>
								<td>
									<s:property value="#entity.name" />
								</td>
								 <td><s:if test="%{#entity.type == 1}">
    									主日录音
     								   </s:if>
     								   <s:if test="%{#entity.type == 2}" >
          							            属灵文章
     								   </s:if>
   									 </td>
								<td>
									<s:property value="#entity.description" />
								</td>
   
  						  <td><s:if test="%{#entity.image != null}">
    									<img alt="cover" class="newest_img"
										src="userfiles/image/${image}" />
      								  </s:if>
									<s:else>
                     					<img alt="cover" class="newest_img"
										src="images/noImage.jpg" />
      								  </s:else></td>
   							 <td><a href="${entity.url}" target="_blank">${url }</a></td>
   							 <td>${operator }</td>
  							  <td><s:date name='gmtCreate' format='yyyy-MM-dd HH:mm'/></td>
  							  <td><s:date name='gmtModify' format='yyyy-MM-dd HH:mm'/></td>
  							  <td><a href='<s:url action="editResource"><s:param name="id" value="id" /></s:url>'>修改</a>&nbsp;
    							<a onclick="return confirm('确定要删除吗？');" href='<s:url action="delResource"><s:param name="id" value="id" /></s:url>'>删除</a></td>
   						 </tr>
   						 </s:iterator>
					</table>
					<s:include value="/share/page.jsp"/>
				</s:if>
				<s:else>
				没有记录
				</s:else>
				  <p>
   					 <a href='<s:url action="beforeAddResource"/>'>新增资源</a>
  					 </p>
			</s:form>
			
		</div>
 
  </body>
</html>
